package cn.tedu.boot011.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
@Controller
public class BMIController {
    @RequestMapping("/BMI")
    @ResponseBody
    public String bmi(double h,double w){
        double value = w/(h*h);
        if(value>0&&value<18.5) {
            return "你的BMI值为" + value + "偏瘦";
        }
        if(value<=24){
            return "你的BMI值为"+value+"正常";
        }
        if(value<=28){
            return "你的BMI值为"+value+"微胖";
        }
        if(value>28){
            return "你的BMI值为"+value+"有点胖了";
        }
        return "";


    }
}
